How to solve "Warning: mail() [function.mail]: SMTP server response: 530 Relaying not allowed - sender domain not local in D:\\... " Error?

Posted by Kiran Rs on Server Fault See other posts from Server Fault or by Kiran Rs
Published on 2013-11-11T09:17:18Z Indexed on 2013/11/11 9:59 UTC
Read the original article Hit count: 1550

Filed under:
|

I have a contact page where users can contact me via that form. But I'm getting this error,

Warning: mail() [function.mail]: SMTP server response: 530 Relaying not allowed - sender domain not local in D:\INETPUB\VHOSTS\nextoption.in\httpdocs\auto-replay\contact.php on line 33

My Php code is,

if(isset($_POST['send'])) //if "email" is filled out, send email { //send email $email1=$_POST['email'];

$headers = "From: My site\r\n";

$headers .= "Reply-To: [email protected]\r\n";

$headers .= "Return-Path: [email protected]\r\n";

$headers .= "X-Mailer: Drupal\n"; $headers .= 'MIME-Version: 1.0' . "\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $to = "[email protected]";

$subject = "Test mail"; $message = "Hello!This is a simple email message

$from = $email1; mail($to,$subject,$message,$headers); ?>

alert ("Enquiry form submited successfully ! We'll get back you soon ");

What will be my fault..... What is the Fault in SMTP Server?

© Server Fault or respective owner

Related posts about php

Related posts about smtp